Part Number Hot Search : 
5224B 38B5M MC34262 TLE426 SMBB26 ADMC401 101KL 5K11FKR3
Product Description
Full Text Search
 

To Download AN678 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  application note a AN678 / 0495 lcd driving with st6240 introduction lcd panels are more and more used in a wide range of applications. the reasons of this success are their low consumption, the enhanced er- gonomy they provide to the application, and the possibility to use customized graphical patterns on the panel. using a lcd driver mcu allows to take profit of the lcd panels features without having to worry about the complex dynamic control interface they re- quire. the lcd driver mcu takes care of the timing control, while the user software selects which of the segment is highlighted: the lcd panel is man- aged as a data array in ram memory. this application note describes the basic guide- lines to achieve a fast and efficient lcd drive appli- cation development. the alphanumeric lcd panel of the st624x starter-kit is used as example and more general concerns are highlighted. hardware and software issues are described to demonstrate the benefits brought about while using a st62 lcd driver. lcd interfacing description st6240 lcd driver overview note: this is a quick summary of the features of the st6240 lcd driver. refer to the st6240 data book for more detailed information. the st6240 lcd driver consists of lcd control logic, a programmable prescaler, a 24 bytes wide dedicated lcd ram, 45 segments and 4 common outputs. this allows direct driving of up to 180 lcd segments. the lcd control logic operates automatically and without interruption of the processor. software configuration of the lcd driver is made by access to locations of the st6240 data reg- isters area: lmcr (lcd mode control register) allows the number of common backplanes (duty cycle) and the frame frequencies used by the lcd control to be set. lcd ram (24 bytes) is used to set each segment to on or off state only by setting or resetting the corresponding bit. according to the contents of the lcd ram, the drivers generate the segments and common signals which can directly drive an lcd panel. x b d f e c gk ln h j dp i m vr0a1879 e d m g l c dp n k h f i a b j e d m g l e c dp n k d m l g n k x h f i a b j f x h i j a c dp b digit digit digit digit 7 6 54 digit d digit 3 dp e x f n l m gk l c e g a h j i x bf h d d d 2 dp digit 1 dp 0 digit dp n m c e k n l m gk x j i a bf h j i a l c e g n m c k x bf h j i a b a x 8 alphanumeric digits lcd figure 1. display layout 1/10
hardware configuration requirements are reduced to minimum: vlcd input pin must be fed with vlcd voltage (in- dependently from v dd ) according to the users lcd panel specifications. vlcd1/3, vlcd2/3 pins are connected to inter- mediate vlcd voltages to enable external capaci- tive buffering or resistive shunting. an internal resistor network is implemented so that in most cases, no additional components are necessary. this lcd control driver may be considered as a very easy to implement black box, thus relieving user of hardware considerations. to implement lcd panel interfacing, the user only has to: - determine the operating lmcr register value according to the lcd panel specifications. - generate the correct vlcd voltage and, if needed, connect an external resistor network on vlcd1/3, vlcd2/3 pins. - determine the most suitable mapping between the lcd panel segments and the lcd ram bits. once this is done, controlling the lcd panel be- comes as easy as usual software bit modification operations. starter kit lcd panel interfacing description the following paragraphs describe in detail how the starter kit lcd panel is interfaced to the st6240 microcontroller. they may also be read as an example of simple lcd interfacing with information for user own lcd control software development. 8 alphanumeric digits lcd panel description lcd interfacing description (continued) x a b d f e c gk ln h j dp i m vr001879 figure 2. digit graphic elements layout x a b d f e c gk ln h j dp i m vr0b1879 e d m g l c dp n k x h f i a b j e d m g l e c dp n k d m l g n k x h f i a b j f x h i j a c dp b com1 com2 com3 com4 figure 3. on graphic segments according to active com a lcd driving with st6240 2/10
the lcd panel used on st6240 starter kit is an 8 alphanumeric digit display. each digit is based on a 16 segment matrix operat- ing in multiplexed mode (1/4 duty) so that only 4 segments pins are required per digit. this gives, for the 8 digits: - 32 segments pins - 4 commons pins vlcd operating mode is 5v. digits are annotated from 0 to 7 respectively from right to left. each digit is composed by 16 graphic elements (a,b,c,d ....) as described in figure 2. lcd interfacing description (continued) pin segments pin segments pin segments 1 7x7f7e7d131x1f1e1d252a2b2c2dp 2 7i7j7k7n141i1j1k1n262h2g2l2m 3 6x6f6e6d150x0f0e0d273a3b3c3dp 4 6i6j6k6n160i0j0k0n283h3g3l3m 5 5x 5f 5e 5d 17 . . . co4 29 4a 4b 4c 4dp 65i5j5k5n18. .co3.304h4g4l4m 7 4x4f4n4d19 .co2. . 315a5b5c5dp 8 4i 4j4k4n20co1. . . 325h5g5l5m 9 3x 3f 3e 3d 21 0a 0b 0c 0dp 33 6a 6b 6c 6dp 10 3i 3j 3k 3n 22 0h 0g 0l 0m 34 6h 6g 6l 6m 11 2x 2f 2e 2d 23 1a 1b 1c 1dp 35 7a 7b 7c 7dp 12 2i 2j 2k 2n 24 1h 1g 1l 1m 36 7h 7g 7l 7m com c1 c2 c3 c4 com c1 c2 c3 c4 com c1 c2 c3 c4 table 1. digit matrix to segment/com pins mapping each elementary graphic segment can be set on or off depen ding on the state of its dedicated segment and common lines, according to the boolean equation: graphic on = seg_line active and com_line active each digit requires 4 seg lines x 4 com lines to be completely defined. table 3 describes the assignment between graphic elements set and the segment/common pins. for example the elementary graphism 7j (j of digit 7) is driven by segment line s2 (pin 2) and common line c2 (pin 19). other example: pin 12 drives, for digit 2, the segments i,j,k,n when respectively commons c1,c2,c3,c4 are active. a lcd driving with st6240 3/10
interfacing the lcd panel with st6240 lcd driver - characters definition no precise rule can be provided concerning the methodology that will lead to the lcd interfacing chart; it depends on the lcd panel used. but beyond any other considerations, the user is strongly advised to think about the application soft- ware architecture before definitively deciding on the mapping of the lcd segments. assigning the lcd panel segments to the lcd ram bits must be made with the aim of generating the most user friendly software description of the lcd interfacing description (continued) graphics that will be displayed on the panel. for in- stance, for this lcd panel, the graphics are shown to be alphanumeric characters. the description map of each character in lcd ram should be the same, whichever digit position it is displayed at. the contrary would increase the complexity of ap- plication software . the lcd panel requires 32 segments lines multi- plexed through 4 common lines. this is less than the capabilities of the st6240. s9 to s39 segments and com1,2,3,4 outputs of st6240 lcd driver are con- nected to the lcd panel inputs as described in fig- ure13 (see also the board scheme). vr001880 digit 6 digit 5 digit 4 digit 3 digit 2 digit 1 digit 0 digit 7 com4 com3 com1 com2 36 35 s40 s38 1 2 s39 s37 st6240 outputs s33 s35 3 4 s36 s34 33 34 s29 s31 5 6 s32 s30 31 32 s25 s27 7 8 s28 s26 29 30 s21 s23 9 10 s24 s22 27 28 s17 s19 11 12 s20 s18 25 26 s13 s15 13 14 s16 s14 23 24 s9 s11 15 16 s12 s10 21 22 com4 com3 com1 com2 st6240 outputs lcd panel 20 19 17 18 figure 4. lcd panel pinout a lcd driving with st6240 4/10
lcd interfacing description (continued) this connection array leads to the digit organisa- tion in the lcd ram described in table 4. notice that the memory is not entirely used. each digit is represented by 4 bits (msb for odd digits, lsb for even digits) in each com memory area. lcd ram address d7 d6 d5 d4 d3 d2 d1 d0 com1 e1h digit 1 digit 0 e2h digit 3 digit 2 e3h digit 5 digit 4 e4h digit 7 digit 6 com2 e7h digit 1 digit 0 e8h digit 3 digit 2 e9h digit 5 digit 4 eah digit 7 digit 6 com3 edh digit 1 digit 0 eeh digit 3 digit 2 efh digit 5 digit 4 f0h digit 7 digit 6 com4 f3h digit 1 digit 0 f4h digit 3 digit 2 f5h digit 5 digit 4 f6h digit 7 digit 6 table 2. digit locations in lcd ram bit 7/3 bit 6/2 bit 5/1 bit 4/0 com1 hxa i com2 gfb j com3 leck com4 m d dp n table 3. lcd ram bits mapping these 4 bits x 4 coms = 16 bits are assigned to the 16 defined above as described in table 5. this de- scription is valid for each digit. this table format can be useful to define the digit character set. each character displayable on the lcd panel is completely defined by a pattern (0-1) of the 16 bit table. a lcd driving with st6240 5/10
lcd interfacing description (continued) the following examples describe this method. example 1: character a definition figure 5 represents the a character to be dis- played on the lcd panel. the on are shown darkened and the off ones are left blank. table 6 gives the corresponding bit pattern to be set into the lcd ram to see the character a dis- played on the lcd panel. 0" bits locations are left blank, 1" bits are shadowed. the right column gives the corresponding hexadecimal value. this description is valid for any number of digit. the position of the displayed character depends only on the addresses and the position (ls/ms nib- ble) where the 4 x 4 bits set are written as de- scribed in table 4. x a b d f e c gk ln h j dp i m vr0c1879 figure 5. character a d3 d2 d1 d0 hex val com1 hxa i 2 com2 gfb j e com3 leck 7 com4 mddpn 0 table 4. character a definition bit map x a b d f e c gk ln h j dp i m vr0d1879 figure 6. character 3 d3 d2 d1 d0 hex val com1 hxa i 2 com2 gfb j a com3 leck 3 com4 mddpn 4 table 5. character 3 definition bit map example 2: character 3" definition in the same way, figure 6 and table 7 represents the definition of the 3" character . this method can be used to define all the character set to be displayed on the lcd panel. the set of 4 x 4 bits (representing the character set) can be stored into the st624x data rom and easily used by display software through indexed accesses. a blank digit array and a bit map table are available on the next page to be used for personal character definition. a lcd driving with st6240 6/10
lcd interfacing description (continued) user character definition chart for lcd provided with the st6240 starter kit user character definition: x a b d f e c gk ln h j dp i m vr001879 x a b d f e c gk ln h j dp i m vr001879 user character definition: d3 d2 d1 d0 hex val com1 hxa i com2 gfb j com3 leck com4 m d dp n d3 d2 d1 d0 hex val com1 hxa i com2 gfb j com3 leck com4 m d dp n shade block corresponding to the segments used and enter the resulting hex number in the last column. a lcd driving with st6240 7/10
lcd interfacing description (continued) starter kit lcd panel character set software model. as described in the previous paragraphs, lcd connection and bit mapping definition of the char- acters set are driving a software model of the lcd displayable objects. these objects are available for display routines to simply perform lcd panel display during pro- gram execution. as examples of display software organisation, please read the following lines. these methods are illustrated in the st6240 starter kit exercises. 1- direct code lcd ram patching this is the most simple way to perform the display of a digit. the bit map values of character are directly patched into the corresponding lcd ram locations. the bit map value are contained in the immediate values of write instructions. (example 1). disp_a_0 ldi e1,x2 ; v alue 2 into digit0 com1 add. (e1,lsb) ldi e7,xe ; value e into digit0 com2 add. (e7,lsb) ldi ed,x7 ; value 7 into digit0 com3 add. (ed,lsb) ldi f3,x0 ; value 0 into digit0 com4 add. (f3,lsb) x is the value of msb (digit 1) example 1. display character a at digit 0 (see figure 3 and figure 1) this method should be used only for very simple applications (few characters, displayed few times ) or just for rapid evaluation. 2- indexed data rom use the bit-map values of characters set are defined into st6240 data rom area (refer to st6240 and ast6/lst6 data books). the .byte, .w, .d directives of ast6/lst6 tools provide definition and access to data rom area (refer to the appro- priate documentation). a generic display call subroutine can access to the character bit definition map through parameter from the calling program. this, of course, is an illustration example of the principle. the described disp_0 subroutine only displays the character at fixed digit 0 and at the same time clears digit 1 (msb of the same lcd ram locations). definition in data rom: char_a. .byte 02 .byte 0e .byte 07 .byte 00 display routine: disp_a_0 ldi rwsr,char_a.w ; data rom window register is set ldi x,char_a.d ; x index point to char_a first byte. call disp_0 ; generic subroutine that displays at 0 digit disp_0 ld e1,(x) ; value 2 into digit0 com1 add. (e1,lsb) inc x ; x points to second byte ldi e7,(x) ; value e into digit0 com2 add. (e7,lsb) inc x ; x points to third byte ldi ed,(x) ; value 7 into digit0 com3 add. (ed,lsb) inc x ; x points to fourth byte ldi f3,(x) ; value 0 into digit0 com4 add. (f3,lsb) example 2. display character a at digit 0 (see figure 3 and figure 1) a lcd driving with st6240 8/10
lcd interfacing description (continued) an efficient generic display subroutine should manage the digit number (as input parameter) and perform the read/modify/write only on the nibble concerned of the lcd ram byte (msb or lsb). this is done by the display subroutine delivered with the st6240 starter kit library. (please read the readme file of the sk6240lib directory). note: a character requires 4 x 4 bits words = 16 bits to be completely defined. to optimize the char- acter set size in data rom, it is useful to compact these 16 bits into 2 bytes, however this method would slightly increase the display routine com- plexity. for st6240 starter kit demo routines, the character set is defined as follows (for example character a): char_a. .byte 22 .byte ee .byte 77 .byte 00 4 bytes are used to define a character, with msb and lsb equal to the 4 bit definition values. by this way, discrimination between msb and lsb is eas- ily done by using the and instruction for masking the non-relevant nibble. .org x00 ; beginning of a window 0 char_@ .byte 22 ; address 0 in the window .byte aa .byte bb .byte 44 1 char_a .byte 22 ; address 3 in the window .byte ee .byte 77 .byte 00 . . . . . . . . . f char_o .byte 22 ; address 3c in the window .byte 66 .byte 66 .byte 44 ; last address (3f) in the wi ndow example 3. ascii characters in data rom window 3- complete message display to define complete messages, it is interesting to use the asciz directive of ast6/lst6 software tools. e.g. mess .asciz hello this directive returns the ascii code pattern of the characters of message (ended by null). in order to use this possibility, the st6240 charac- ter set is implanted into data rom so that it be- comes simple to reach a definition bit-map through the character ascii code. principle: one data rom window contains 64 bytes. as a character definition bit map requires 4 bytes, 16 characters can be defined in a whole win- dow. this corresponds to a page of ascii codes (represented by the msb of ascii code). for example characters @,a,b ...,o whose ascii codes are respectively (hex) 40,41,42 ...,4f repre- sent the ascii code page 4, and fill a complete data rom window as in example 3. for example, the ascii code of character a is 41 (hex): - 4 is the number of the window - 1 indexes the number of the character in the window the displayable (not all the ascii code chart) character set delivered with the st6240 starter kit library satisfies this principle. this allows the asci_dis subroutine to display a character defined by its ascii code and dis_mes subroutine to display on lcd panel a complete message built with the asciz ast6 directive. refer to sk6240li.ini and sk6240li.asm files in the sk6240lib directory for description of these subroutines. a lcd driving with st6240 9/10
information furnished is believed to be accurate and reliable. however, sgs-thomson microelectronics assumes no responsibility for the consequences of use of such information nor for any infringement of patents or other rights of third parties which may result f rom its use. no license is granted by implication or otherwise under any patent or patent rights of sgs-thomson microelectronics. specification s mentioned in this publication are subject to change without notice. this publication supersedes and replaces all information previously s upplied. sgs-thomson microelectronics products are not authorized for use as critical components in life support devices or systems with out the express written approval of sgs-thomson microelectronics. ? 1995 sgs-thomson microelectronics - all rights reserved. purchase of i 2 c components by sgs-thomson microelectronics conveys a license under the philips i 2 c patent. rights to use these components in an i 2 c system is granted provided that the system conforms to the i 2 c standard specification as defined by philips. sgs-thomson microelectronics group of companies australia - brazil - china - france - germany - hong kong - italy - japan - korea - malaysia - malta - morocco - the netherland s singapore - spain - sweden - switzerland - taiwan - thailand - united kingdom - u.s.a. a lcd driving with st6240 10/10


▲Up To Search▲   

 
Price & Availability of AN678

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X